
<extend name="./App/Common/View/default/Base/common.html" />
<block name="main_content">
    <include file="./App/Common/View/default/Public/crumb.html" />
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li class="active">
                        <a href="javascript:void(0)">产品管理</a>
                    </li>
                    <!-- <li class="">
                        <a href="#">抽奖商品</a>
                    </li> -->
                </ul>
            </h3>
        </div>
        <div class="tab-content mod-content">
            <div class="table-responsive">
                <div>
                    <a style="padding:2px 10px; font-size:96%; color:#fff; background:#337ab7; border-radius: 5px; border: none;display:inline-block; text-align:center;" href="{:U('listadd')}">新增记录</a>
                </div>               <!--公众号搜索功能-->
                <style>
                   /* #jilu{
                        font-size: 13px;
                        line-height: 15px;
                    }*/
                    input[placeholder], [placeholder], *[placeholder] {
                        color:#778899 !important;
                    }
                    form{margin:0px;display: inline}
                    .search{
                            width:200px;
                            height: 25px;
                            border-radius: 5px;
                            border: 1px solid #ccc;
                            padding-left: 10px;
                            box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
                        }
                    #select{
                            border-radius: 5px;
                            border: 1px solid red;
                        }
                        td{
                            display:table-cell; 
                            vertical-align:middle;
                        }
                    .pages a,.pages span {
                        display:inline-block;
                        padding:2px 5px;
                        margin:0 1px;
                        border:1px solid #f0f0f0;
                        -webkit-border-radius:3px;
                        -moz-border-radius:3px;
                        border-radius:3px;
                    }
                    .pages a,.pages li {
                        display:inline-block;
                        list-style: none;
                        text-decoration:none; color:#58A0D3;
                    }
                    .pages a.first,.pages a.prev,.pages a.next,.pages a.end{
                        margin:0;
                    }
                    .pages a:hover{
                        border-color:#50A8E6;
                    }
                    .pages span.current{
                        background:#50A8E6;
                        color:#FFF;
                        font-weight:700;
                        border-color:#50A8E6;
                    }
                        table{
                            width:100px;
                            table-layout:fixed;/* 只有定义了表格的布局算法为fixed，下面td的定义才能起作用。 */
                        }
                        td{
                            width:100%;
                            word-break:keep-all;/* 不换行 */
                            white-space:nowrap;/* 不换行 */
                            overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
                            text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ；需与overflow:hidden;一起使用*/
                            }
                </style>
                <div id="msg">
                <div id="showdiv">
                    <div id="">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th style="">序号</th>
                                <th style="">产品标题</th> 
                                <th style="">产品图片</th> 
                                <th style="">产品分类</th>
                                <th style="">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="list" key="k" id="vo">
                                <tr>
                                    <td style="vertical-align:middle">{$vo.id}</td>
                                     <td style="vertical-align:middle">{$vo.title}</td>
                                    <td style="vertical-align:middle"><img style="width: 100px;height: 100px" src="{$vo.picture}"/></td>
                                    <td class="line-limit-length" style="vertical-align:middle">
                                    {$vo.name}
                                    </td>
        <!--                            <td style="width:800px">{$vo.content}</td> -->
                                    <td style="width:10%;vertical-align:middle">
                                        <a href="{:U('listsave',array('id'=>$vo['id']))}"><img src="http://www.mobtop.com.cn/edit.gif" alt="" width='12px' height='12px'></a>  &nbsp;&nbsp; <a href="javascript:void(0);" onclick="del({$vo.id})"><img src="http://www.mobtop.com.cn/del.gif" alt="" width='15px' height='15px'></a>
                                        <input type="hidden" id="delete" value="{:U('listdelete')}"/>

                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                      <div style="text-align: center;" class='pages'>{$page}</div>
                    </div>
                </div>
                    <input type="hidden" name="__hash__" value="5786ea04b995bc596bb908419e9d38eb_21e697ebb3336580cc76eafc7ebda4a6" />
                    <input type="hidden" class='count' value="{$count}"/>
                    <div class="mod-table-foot">

                        <div class="page-control"><ul class="pagination pull-right">    </ul></div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="script">
<!-- <link rel="stylesheet" href="__PUBLIC__/Admin/js/layui/css/layui.css" media="all">
<script src="__PUBLIC__/Admin/js/layui/layui.js"></script> -->

    <script type="text/javascript">
         $(".check-all").on('ifChecked', function (e)
        {
            // alert(1);
            e.preventDefault();

            $('.table').find(".icheckbox_square-blue").iCheck('check');
        });

        $(".check-all").on('ifUnchecked', function (e)
        {
            // alert(0);
            e.preventDefault();

            $('.table').find(".icheckbox_square-blue").iCheck('uncheck');

        });

        function del(obj) {
            var url = $('#delete').val()
            if (confirm('你确定删除吗？')) {
                location.href=url+"&id="+obj
            }
        }
        var tableFristText = $('.table-title-text');
        tableFristText.each(function(i,elem){
            var sl = "...";
            var html = "";
            if($(elem).html().length >4){
                html = $(elem).html().slice(0,4) + sl;
            }else {
                html = $(elem).html();
            }
            $(elem).html(html);
        });

        function gopage(){
            var page = $("#p").val();
            window.location.href='index.php?s=/Admin/Branch/lists/p/'+page;
        }
        function delall(){
            if(confirm('你确定要删除多项吗？')){
                var id = document.getElementsByName("id");
                // alert(own_id.length);
                var str = '';
                var lengths = id.length;
                for(var i=0;i<lengths;i++){  
                    if(id[i].checked)  
                    str+=id[i].value+',';   
                }
                // alert(str);
                var postUrl = "{:U('Admin/Branch/delall')}";
                $.get(postUrl,{'id':str},function(data){
                    if (data.status == 1) {
                        bootAlert(data.info);
                        window.location.href="{:U('Admin/Branch/lists')}";
                    } else {
                        bootAlert(data.info);
                    }
                });
                }
            
        }
        // function checkall(){

        // }
        
    </script>
</block>

  

 

 

